﻿using System;
using IkeCode.WP7.HQReader.Model;
using System.Collections.Generic;
using IkeCode.WP7.HQReader.Interfaces;
using System.Diagnostics.CodeAnalysis;

namespace IkeCode.WP7.HQReader.Services.Design
{
    /// <summary>
    /// 
    /// </summary>
    public class DesignFeedDataService : IFeedDataService
    {
        /// <summary>
        /// 
        /// </summary>
        /// <param name="trySync"></param>
        /// <param name="callback"></param>
        public void GetAllFeeds(bool trySync, Action<Dictionary<IIcFeedPublisher, List<IIcFeed>>, Exception> callback)
        {
        }

        /// <summary>
        /// 
        /// </summary>
        /// <param name="trySync"></param>
        /// <param name="publisher"></param>
        /// <param name="callback"></param>
        public void GetFeeds(bool trySync, IIcFeedPublisher publisher, Action<List<IIcFeed>, Exception> callback)
        {
            var item = new List<IIcFeed>();
            
            var id = new Guid();
            var title = "Desligando…";
            var description = new List<string> { "transcription", "asdasdasd", "qweqweqweqw" };
            var url = "http://vidadeprogramador.com.br/2013/09/21/desligando/";
            var commentsCount = 14;
            var dateIns = DateTime.Now;
            var image = "http://vidadeprogramador.com.br/wp-content/uploads/2013/09/tirinha1074.png";
            var publisherName = "Vida de Programador";
            var listItem = new IcFeedModel(id, url, title, dateIns, image, description, commentsCount, publisherName);
            item.Add(listItem);
            
            var id2 = new Guid();
            var title2 = "Solicitação de compra";
            var description2 = new List<string> { "2 transcription", "2 asdasdasd", "2 qweqweqweqw" };
            var url2 = "http://vidadeprogramador.com.br/2013/09/20/solicitacao-de-compra/";
            var commentsCount2 = 27;
            var dateIns2 = DateTime.Now.AddDays(2);
            var image2 = "http://vidadeprogramador.com.br/wp-content/uploads/2013/09/tirinha1073.png";
            var listItem2 = new IcFeedModel(id2, url2, title2, dateIns2, image2, description2, commentsCount2, publisherName);
            item.Add(listItem2);
            
            callback(item, null);
        }
    }
}